package com.javafactroy.kunlong.bip.icp.message.data.base;

import com.javafactroy.kunlong.bip.icp.message.data.iface.AppBase;
import com.javafactroy.kunlong.bip.icp.message.base.consts.AppEnum;
import lombok.Data;

import java.nio.ByteBuffer;

@Data
public class AppHeader implements AppBase {
    byte[] byteBuffer;
    int msgId;
    String msgType;
    int msgLen;
    @Override
    public void init(byte[] byteBuffer) {
       this. byteBuffer = byteBuffer;
    }

    public void decode(AppByteBuffer byteBuffer) {

        ByteBuffer buffer = byteBuffer.appPosition.copyHeader();
        byteBuffer.setMsgType(AppEnum.MsgTypeEnum.request);
    }

    public void encode(AppByteBuffer byteBuffer) {

    }
    public void decode(byte[] byteBuffer) {

    }


}
